<?php

namespace App\Http\Controllers\CmsApi;

use Illuminate\Http\Request;
use App\Lib\Response;
use App\Http\Model\Hint;
use App\Http\Controllers\BaseController;
use App\Http\Services\FullServices;

class InnerFullController extends BaseController
{
    protected $fullService;

    public function __construct()
    {
        $this->fullService = new FullServices();

    }

    /**
     * 留言板人工审核并发飘萍
     */
    public function lybFullScreen(Request $request)
    {
        $id = $request->input('id');
        //人工审状态 0=待审核 1=通过 2=不通过
        $b_status = $request->input('b_status');
        //备注
        $remind = $request->input('remind');
        if(empty($id) || empty($b_status)) {
            Response::returnResult(Hint::PARAM_ERROR); 
        }

        //锁
        $ifLock = redis_lock('LYB:lybFullScreen:'.$id, 5);
        if (!$ifLock){
            Response::returnResult(Hint::SAME_TIME_NOT_REPEAT);
        }

        $data = $this->fullService->lybFullScreen($id, $b_status, $remind);
        if($data['code'] != Hint::SUCCESS) {
            Response::returnResult($data['code'], $data['data'], $data['msg']);
        }

        Response::returnResult(Hint::SUCCESS);
    }


}